package darklaunch

import (
	"io"
	"os"
)

type Loader interface {
	Load() (string, error)
}

type FileLoader struct {
	filepath string
}

func (fl *FileLoader) Load() (string, error) {
	file, err := os.Open(fl.filepath)
	if err != nil {
		return "", err
	}

	defer file.Close()

	data, err := io.ReadAll(file)
	if err != nil {
		return "", err
	}
	return string(data), nil
}
